home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-12-16 | 23.8 KB | 830 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Content.cpp
- // Release Version: $ ODF 3 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef CONTENT_H
- #include "Content.h"
- #endif
-
- #ifndef PART_H
- #include "Part.h"
- #endif
-
- #ifndef FRAME_H
- #include "Frame.h"
- #endif
-
- #ifndef PROXY_H
- #include "Proxy.h"
- #endif
-
- #ifndef SELECTION_H
- #include "Selection.h"
- #endif
-
- #ifndef LINKING_H
- #include "Linking.h"
- #endif
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWFRMING_H
- #include "FWFrming.h"
- #endif
-
- #ifndef FWPRESEN_H
- #include "FWPresen.h"
- #endif
-
- #ifndef FWITERS_H
- #include "FWIters.h"
- #endif
-
- #ifndef FWKIND_H
- #include "FWKind.h"
- #endif
-
- #ifndef FWMEMMGR_H
- #include "FWMemMgr.h"
- #endif
-
- #ifndef FWSUSINK_H
- #include "FWSUSink.h"
- #endif
-
- #ifndef FWSUUTIL_H
- #include "FWSUUtil.h"
- #endif
-
- #ifndef FWODMISC_H
- #include "FWODMisc.h"
- #endif
-
- #ifdef __MRC__
- // This is to go around a bug in MRC. It doesn't seems to see the extern
- // in Proxy.cpp
- FW_DEFINE_AUTO_TEMPLATE(FW_TRefCountedCollection, CTableProxy)
- #endif
-
- //========================================================================================
- // Segmentation
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment odfTable
- #endif
-
- //========================================================================================
- // class CTablePartContent
- //========================================================================================
-
- FW_DEFINE_AUTO(CTablePartContent)
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::CTablePartContent
- //----------------------------------------------------------------------------------------
-
- CTablePartContent::CTablePartContent(Environment* ev, CTablePart* part) :
- FW_CContent(ev, part),
- fTablePart(part),
- fProxys(NULL),
- fExtent(FW_IntToFixed(kDrawingSizeX), FW_IntToFixed(kDrawingSizeY)),
- fWidth(NULL),
- fHeight(NULL)
- {
- // ----- Create list of proxies -----
- fProxys = FW_NEW(CTableProxyCollection, ());
-
- fMaxRowCol.fX = kMaxCols;
- fMaxRowCol.fY = kMaxRows;
-
- AllocateArrays();
-
- FW_Fixed w = FW_RoundedToInt((fExtent.x / FW_IntToFixed(fMaxRowCol.fX)) - kPenWidth - FW_kFixedPos1);
- FW_Fixed h = FW_RoundedToInt((fExtent.y / FW_IntToFixed(fMaxRowCol.fY)) - kPenHeight - FW_kFixedPos1);
-
- // ----- Initialize arrays
- unsigned long s;
- for(s=0; s < fMaxRowCol.fX; s++)
- fWidth[s] = w;
-
- for(s=0; s < fMaxRowCol.fY; s++)
- fHeight[s] = h;
-
- // ----- Adjust fExtent
- fExtent.x = FW_RoundedToInt((w + kPenWidth) * FW_IntToFixed(fMaxRowCol.fX) + kPenWidth);
- fExtent.y = FW_RoundedToInt((h + kPenHeight) * FW_IntToFixed(fMaxRowCol.fY) + kPenHeight);
-
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::~CTablePartContent
- //----------------------------------------------------------------------------------------
-
- CTablePartContent::~CTablePartContent()
- {
- FW_START_DESTRUCTOR
-
- delete fProxys; // Releases all the proxy's
- DisposeArrays();
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::ExternalizeKind
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::ExternalizeKind(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CKind* kind,
- FW_StorageKinds storageKind,
- FW_CPromise* promise,
- FW_CCloneInfo* cloneInfo)
- {
- FW_UNUSED(kind);
- FW_UNUSED(storageKind);
- FW_UNUSED(promise);
-
- // ---- Write out grid info ----
- FW_PStorageUnitSink suSink(ev, storageUnit, kODPropContents, fTablePart->GetPartKind(ev)->GetType(ev));
- FW_CWritableStream stream(suSink);
-
- stream << fMaxRowCol.fX;
- stream << fMaxRowCol.fY;
- stream.Write(fWidth, ((long)fMaxRowCol.fX) * sizeof(FW_Fixed));
- stream.Write(fHeight, ((long)fMaxRowCol.fY) * sizeof(FW_Fixed));
-
- // ---- Write number of embedded parts ----
- unsigned long partCount = fProxys->Count();
- stream << partCount;
-
- // ---- Write out embedded frames ----
- if (partCount > 0)
- {
- CTableProxyCollectionIterator iter(fProxys);
- for (CTableProxy* proxy = iter.First(); iter.IsNotComplete(); proxy = iter.Next())
- {
- CCell cell = proxy->GetCell();
- stream << cell.fX;
- stream << cell.fY;
- proxy->Externalize(ev, suSink->GetStorageUnitView(ev), cloneInfo);
- }
- }
-
- // ----- Externalize Link -----
- if (storageKind == FW_kPartStorage)
- {
- //--- Write source and destination links, if any ---
- CTableLinkManager* linkMgr = (CTableLinkManager*) fTablePart->GetLinkManager(ev);
- linkMgr->ExternalizeLinks(ev, storageUnit, cloneInfo);
- }
-
- // ----- Cleaned up end of value -----
- FW_SUDeleteEndOfFocusedValue(ev, storageUnit);
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::InternalizeKind
- //----------------------------------------------------------------------------------------
-
- FW_Boolean CTablePartContent::InternalizeKind(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CKind* kind,
- FW_StorageKinds storageKind,
- FW_CCloneInfo* cloneInfo)
- {
- FW_UNUSED(kind);
- FW_UNUSED(storageKind);
-
- // ---- Read grid info -----
- FW_PStorageUnitSink suSink(ev, storageUnit, kODPropContents, fTablePart->GetPartKind(ev)->GetType(ev));
- FW_PBufferedSink sink(ev, suSink);
- FW_CReadableStream stream(sink);
-
- stream >> fMaxRowCol.fX;
- stream >> fMaxRowCol.fY;
-
- AllocateArrays();
-
- stream.Read(fWidth, ((long)fMaxRowCol.fX) * sizeof(FW_Fixed));
- stream.Read(fHeight, ((long)fMaxRowCol.fY) * sizeof(FW_Fixed));
-
- // ---- Read number of embedded parts ----
- unsigned long partCount;
- stream >> partCount;
-
- // ---- Read embedded parts ----
- CCell cell;
- CTableProxy* proxy;
- for (unsigned long i = 0; i < partCount; i++)
- {
- stream >> cell.fX;
- stream >> cell.fY;
- proxy = new CTableProxy(ev, fTablePart, this);
- proxy->SetCell(cell);
- FW_TRY
- {
- proxy->Internalize(ev, suSink->GetStorageUnitView(ev), cloneInfo); // read part and embed it
- }
- FW_CATCH_BEGIN
- FW_CATCH_EVERYTHING()
- {
- proxy->Release();
- FW_THROW_SAME();
- }
- FW_CATCH_END
-
- this->AddProxy(proxy);
- proxy->Release();
- }
-
- if (storageKind == FW_kPartStorage)
- {
- // ----- Read link information -----
- CTableLinkManager* linkMgr = (CTableLinkManager*) fTablePart->GetLinkManager(ev);
- linkMgr->InternalizeLinks(ev, storageUnit);
- }
-
- return true;
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::DisposeArrays
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::DisposeArrays()
- {
- if (fWidth != NULL)
- FW_CMemoryManager::FreeBlock((void*)fWidth);
- fWidth = NULL;
-
- if (fHeight != NULL)
- FW_CMemoryManager::FreeBlock((void*)fHeight);
- fHeight = NULL;
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::AllocateArrays
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::AllocateArrays()
- {
- DisposeArrays();
-
- fWidth = (FW_Fixed*)FW_CMemoryManager::AllocateBlock(((long)fMaxRowCol.fX) * sizeof(FW_Fixed));
- fHeight = (FW_Fixed*)FW_CMemoryManager::AllocateBlock(((long)fMaxRowCol.fY) * sizeof(FW_Fixed));
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::IsDataOnlyOneProxy
- //----------------------------------------------------------------------------------------
-
- FW_MProxy* CTablePartContent::IsDataOnlyOneProxy(Environment* ev) const
- {
- FW_UNUSED(ev);
- // This method is only called on the content object associated with the selection to
- // test for the Single Embedded Frame case. The part content should just retur NULL.
-
- return NULL;
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::CellToProxy
- //----------------------------------------------------------------------------------------
-
- CTableProxy* CTablePartContent::CellToProxy(const CCell& cell) const
- {
- // Convert a cell to a Proxy pointer by iterating over the list of proxies
-
- CTableProxyCollectionIterator iter(fProxys);
- for (CTableProxy* proxy = iter.First(); iter.IsNotComplete(); proxy = iter.Next())
- {
- if (proxy->GetCell() == cell)
- return proxy;
- }
-
- return NULL;
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::GetCellSize
- //----------------------------------------------------------------------------------------
-
- FW_Fixed CTablePartContent::GetCellSize(short c,FW_XYSelector direction) const
- {
- return direction == FW_kHorizontal ? GetWidth(c) : GetHeight(c);
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::GetWidth
- //----------------------------------------------------------------------------------------
-
- FW_Fixed CTablePartContent::GetWidth(short c) const
- {
- return (c < fMaxRowCol.fX ? fWidth[c] : kDefaultCellWidth);
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::GetHeight
- //----------------------------------------------------------------------------------------
-
- FW_Fixed CTablePartContent::GetHeight(short r) const
- {
- return (r < fMaxRowCol.fY ? fHeight[r] : kDefaultCellHeight);
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::SetWidth
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::SetWidth(short c, FW_Fixed w)
- {
- FW_ASSERT(c < fMaxRowCol.fX);
- fWidth[c] = w;
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::SetHeight
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::SetHeight(short r, FW_Fixed h)
- {
- FW_ASSERT(r < fMaxRowCol.fY);
- fHeight[r] = h;
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::AddProxy
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::AddProxy(CTableProxy* proxy)
- {
- fProxys->AddLast(proxy);
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::RemoveProxy
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::RemoveProxy(CTableProxy* proxy)
- {
- fProxys->RemoveAndRelease(proxy);
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::DeleteProxy
- //----------------------------------------------------------------------------------------
-
-
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::FindLocation
- //----------------------------------------------------------------------------------------
-
- FW_Fixed CTablePartContent::FindLocation(short c, FW_XYSelector direction) const
- {
- return direction == FW_kHorizontal ? FindLeft(c) : FindTop(c);
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::FindLeft
- //----------------------------------------------------------------------------------------
-
- FW_Fixed CTablePartContent::FindLeft(short col) const
- {
- if (col >= fMaxRowCol.fX)
- return fExtent.x;
-
- FW_Fixed x = kBorderWidth;
- for(short c = 0; c < col; c += 1)
- x += this->GetWidth(c) + kBorderWidth;
-
- return x;
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::FindTop
- //----------------------------------------------------------------------------------------
-
- FW_Fixed CTablePartContent::FindTop(short row) const
- {
- if (row >= fMaxRowCol.fY)
- return fExtent.y;
-
- FW_Fixed y = kBorderHeight;
-
- for(short r = 0; r < row; r += 1)
- y += this->GetHeight(r) + kBorderWidth;
- return y;
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::FindRect
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::FindRect(const CCell& cell, FW_CRect& rect) const
- {
- FW_Fixed x = this->FindLeft(cell.fX);
- FW_Fixed y = this->FindTop (cell.fY);
-
- rect.Set(x, y,
- x + this->GetWidth(cell.fX),
- y + this->GetHeight(cell.fY));
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::HitTest
- //----------------------------------------------------------------------------------------
-
- ETableLoc CTablePartContent::HitTest(Environment* ev,
- const FW_CMouseEvent& theMouseEvent,
- FW_CView* view,
- CCell& cell) const
- {
- FW_CPoint where = theMouseEvent.GetMousePosition(ev, FW_CMouseEvent::kFrame);
- view->FrameToViewContent(ev, where);
- return HitTest(ev, where, cell);
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::FindCell
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::FindCell(const FW_CPoint& where, CCell& cell) const
- {
- if (where.x < FW_kFixed0)
- cell.fX = 0;
- else
- {
- short r = 0;
- FW_Fixed x = FW_kFixed0;
- while (TRUE)
- {
- x += kBorderWidth + this->GetWidth(r);
- if (where.x < x || r == fMaxRowCol.fX)
- {
- cell.fX = r;
- break;
- }
- r++;
- }
- }
-
- if (where.y < FW_kFixed0)
- cell.fY = 0;
- else
- {
- short r = 0;
- FW_Fixed y = FW_kFixed0;
- while (TRUE)
- {
- y += kBorderHeight + this->GetHeight(r);
- if (where.y < y || r == fMaxRowCol.fY)
- {
- cell.fY = r;
- break;
- }
- r++;
- }
- }
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::HitTest
- //----------------------------------------------------------------------------------------
-
- ETableLoc CTablePartContent::HitTest(Environment* ev,
- const FW_CPoint& where,
- CCell& cell) const
- {
- FW_UNUSED(ev);
- FindCell(where, cell);
-
- if (cell.fX == fMaxRowCol.fX || cell.fY == fMaxRowCol.fY)
- return kTLNone;
-
- ETableLoc tl = kTLCell;
-
- FW_CRect cellRect;
- FindRect(cell, cellRect);
-
- if (where.x <= cellRect.left)
- tl += kTLLeftBorder;
- else if (cellRect.right <= where.x)
- tl += kTLRightBorder;
-
- if (where.y <= cellRect.top)
- tl += kTLTopBorder;
- else if (cellRect.bottom <= where.y)
- tl += kTLBottomBorder;
-
- if (cell.fY == 0 && ((tl & kTLTopBorder) != 0))
- tl = kTLNone;
-
- if (cell.fX == 0 && ((tl & kTLLeftBorder) != 0))
- tl = kTLNone;
-
- if (cell.fY == fMaxRowCol.fY - 1 && ((tl & kTLBottomBorder) != 0))
- tl = kTLNone;
-
- if (cell.fX == fMaxRowCol.fX - 1 && ((tl & kTLBottomBorder) != 0))
- tl = kTLNone;
-
- return tl;
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::Resize
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::Resize(Environment* ev, const CCell& cell, ETableLoc tl, const FW_CPoint& delta)
- {
- CCell topLeftCell(cell);
-
- if (delta.x != FW_kFixed0)
- {
- if ((tl & kTLLeftBorder) != 0)
- topLeftCell.fX -= 1;
- SetWidth(topLeftCell.fX, GetWidth (topLeftCell.fX) + delta.x);
- }
-
- if (delta.y != FW_kFixed0)
- {
- if ((tl & kTLTopBorder) != 0)
- topLeftCell.fY -= 1;
- SetHeight(topLeftCell.fY, GetHeight(topLeftCell.fY) + delta.y);
- }
-
- // Move all embedded frames
- CTableProxyCollectionIterator ite(fProxys);
- for (CTableProxy* proxy = ite.First(); ite.IsNotComplete(); proxy = ite.Next())
- {
- // Get operations being performed
- CCell frCell = proxy->GetCell();
- FW_Boolean resizing = (frCell.fX == topLeftCell.fX || frCell.fY == topLeftCell.fY);
- FW_Boolean moving = (frCell.fX > topLeftCell.fX || frCell.fY > topLeftCell.fY);
-
- if (resizing || moving)
- proxy->MoveEmbeddedFrames(ev, frCell);
- }
-
- UpdateExtent(ev);
-
- fTablePart->Changed(ev);
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::UpdateExtent
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::UpdateExtent(Environment* ev)
- {
- CCell cell(fMaxRowCol.fX - 1, fMaxRowCol.fY - 1);
- FW_CRect cellRect;
- FindRect(cell, cellRect);
-
- fExtent.x = cellRect.right + kPenWidth;
- fExtent.y = cellRect.bottom + kPenHeight;
-
- FW_CPresentationFrameIterator ite(ev, fTablePart->GetTablePresentation(ev));
- for (FW_CFrame* frame = ite.First(ev); ite.IsNotComplete(ev); frame = ite.Next(ev))
- frame->GetContentView(ev)->SetExtent(ev, fExtent);
- }
-
- //----------------------------------------------------------------------------------------
- // CTablePartContent::AddEmbeddedFrameOrPart
- //----------------------------------------------------------------------------------------
-
- void CTablePartContent::AddEmbeddedFrameOrPart(Environment* ev,
- const CCell& selectionCell,
- FW_CEmbeddingFrame* scopeFrame,
- ODPart* embeddedPart,
- ODFrame* embeddedFrame,
- ODShape* suggestedShape,
- ODTypeToken viewType)
- {
- // A single embedded frame or a part has been internalized (Drag&Drop, Clipboard or Insert).
-
- FW_UNUSED(suggestedShape);
-
- CTableProxy* proxy = CellToProxy(selectionCell);
-
- FW_CRect rect;
- FindRect(selectionCell, rect);
- rect.Place(FW_kZeroPoint);
-
- FW_CAcquiredODShape aqShape = ::FW_NewODShape(ev, rect);
-
- // ----- Create the proxy -----
- CTableProxy* newProxy = new CTableProxy(ev, fTablePart, this);
- newProxy->SetCell(selectionCell);
-
- // ----- Step 6: Embed it -----
- FW_TRY
- {
- if (embeddedPart != NULL)
- {
- newProxy->EmbedPart(ev,
- scopeFrame->GetPresentation(ev),
- embeddedPart,
- kODFrameObject, // I want persistent frames
- aqShape,
- viewType,
- NULL, // no presentation
- 0, // group id
- FALSE, // IsOverlaid
- FALSE); // sub frame
- }
- else
- {
- newProxy->EmbedFrame(ev,
- scopeFrame,
- embeddedFrame,
- aqShape,
- viewType);
- }
- }
- FW_CATCH_BEGIN
- FW_CATCH_EVERYTHING () {
- // cleanup for Step 6
- newProxy->Release();
- FW_THROW_SAME ();
- }
- FW_CATCH_END
-
- // ----- Add the newProxy to the part -----
- AddProxy(newProxy);
-
- // newProxy has been acquired in AddProxy. Releasing it now avoids
- // need for another try block around the rest of the code
- newProxy->Release();
-
- // ----- Delete the old proxy if there was one in the cell
- if (proxy != NULL)
- {
- proxy->DetachEmbeddedFrames(ev);
- RemoveProxy(proxy);
- }
-
- // ----- Select the new proxy -----
- newProxy->SetSelectState(ev, TRUE);
-
- // ----- Change its hilite state -----
- if (scopeFrame && scopeFrame->HasSelectionFocus(ev))
- newProxy->ChangeHighlight(ev, kODFullHighlight, scopeFrame);
- }
-
- //========================================================================================
- // class CTableSelectionContent
- //========================================================================================
-
- FW_DEFINE_AUTO(CTableSelectionContent)
-
- //----------------------------------------------------------------------------------------
- // CTableSelectionContent::CTableSelectionContent
- //----------------------------------------------------------------------------------------
-
- CTableSelectionContent::CTableSelectionContent(Environment* ev, CTablePart* part, CTablePartContent* content) :
- FW_CContent(ev, part),
- fTableContent(content),
- fTablePart(part),
- fCell(0, 0)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // CTableSelectionContent::~CTableSelectionContent
- //----------------------------------------------------------------------------------------
-
- CTableSelectionContent::~CTableSelectionContent()
- {
- FW_START_DESTRUCTOR
- }
-
-
- //----------------------------------------------------------------------------------------
- // IsDataOnlyOneProxy
- //----------------------------------------------------------------------------------------
-
- FW_MProxy* CTableSelectionContent::IsDataOnlyOneProxy(Environment* ev) const
- {
- FW_UNUSED(ev);
- return fTableContent->CellToProxy(fCell);
- }
-
- //----------------------------------------------------------------------------------------
- // CTableSelectionContent::InternalizeKind
- //----------------------------------------------------------------------------------------
-
- FW_Boolean CTableSelectionContent::InternalizeKind(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CKind* kind,
- FW_StorageKinds storageKind,
- FW_CCloneInfo* cloneInfo)
- {
- FW_UNUSED(ev);
- FW_UNUSED(storageUnit);
- FW_UNUSED(kind);
- FW_UNUSED(storageKind);
- FW_UNUSED(cloneInfo);
- // Should never be called because I always internalize a single embedded frame
- return false;
- }
-
- //----------------------------------------------------------------------------------------
- // CTableSelectionContent::ExternalizeKind
- //----------------------------------------------------------------------------------------
-
- void CTableSelectionContent::ExternalizeKind(Environment* ev,
- ODStorageUnit* storageUnit,
- FW_CKind* kind,
- FW_StorageKinds storageKind,
- FW_CPromise* promise,
- FW_CCloneInfo* cloneInfo)
- {
- FW_UNUSED(storageKind);
- FW_UNUSED(promise);
-
- CTableProxy* proxy = GetSelectedProxy(ev);
- FW_ASSERT(proxy);
-
- FW_PStorageUnitSink suSink(ev, storageUnit, kODPropContents, kind->GetType(ev));
- proxy->Externalize(ev, suSink->GetStorageUnitView(ev), cloneInfo);
-
- FW_SUDeleteEndOfFocusedValue(ev, storageUnit);
- }
-
- //----------------------------------------------------------------------------------------
- // CTableSelectionContent::GetSelectedProxy
- //----------------------------------------------------------------------------------------
-
- CTableProxy* CTableSelectionContent::GetSelectedProxy(Environment* ev) const
- {
- FW_UNUSED(ev);
- return fTableContent->CellToProxy(fCell);
- }
-
- //----------------------------------------------------------------------------------------
- // CTableSelectionContent::IncorporateEmbeddedFrame
- //----------------------------------------------------------------------------------------
-
- void CTableSelectionContent::IncorporateEmbeddedFrame(Environment* ev,
- FW_CEmbeddingFrame* scopeFrame,
- ODFrame* embeddedFrame,
- ODShape* suggestedShape,
- ODTypeToken viewType)
- {
- fTableContent->AddEmbeddedFrameOrPart(ev,
- GetCell(),
- scopeFrame,
- NULL,
- embeddedFrame,
- suggestedShape,
- viewType);
- }
-
- //----------------------------------------------------------------------------------------
- // CTableSelectionContent::IncorporateEmbeddedPart
- //----------------------------------------------------------------------------------------
-
- void CTableSelectionContent::IncorporateEmbeddedPart(Environment* ev,
- FW_CEmbeddingFrame* scopeFrame,
- ODPart* embeddedPart,
- ODShape* suggestedShape,
- ODTypeToken viewType)
- {
- fTableContent->AddEmbeddedFrameOrPart(ev,
- GetCell(),
- scopeFrame,
- embeddedPart,
- NULL,
- suggestedShape,
- viewType);
- }
-
- //----------------------------------------------------------------------------------------
- // CTableSelectionContent::AcquireSuggestedFrameShape
- //----------------------------------------------------------------------------------------
-
- ODShape* CTableSelectionContent::AcquireSuggestedFrameShape(Environment* ev)
- {
- // return the shape used for the kODPropSuggestedFrameShape property.
-
- FW_CRect rect;
- fTableContent->FindRect(GetCell(), rect);
-
- return ::FW_NewODShape(ev, rect);
- }
-
-
-